package com.songlanyun.modules.order.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.songlanyun.common.drive.RootEntity;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;

@Data
@TableName("yxt_sale_child_order_service_item")
public class ChildOrderServiceItem extends RootEntity<Long, ChildOrderServiceItem> implements Serializable {


    /**
     *
     */
    @TableId
    private Long id;

    /**
     * 项目名称
     */
    @NotBlank(message = "项目名称不能为空")
    @Length(min = 1, max = 50, message = "项目名称名称长度在1-50个字")
    private String itemName;

    /**
     * 项目次数
     */
    @NotNull(message = "项目次数不能为空")
    @Max(value = 1000,message = "项目次数最大1000")
    @Min(value = 1,message = "项目次数最小是1")
    private Integer num;


    /**
     * 项目价格
     */
    @DecimalMin(value = "0", message = "项目价格最小是0")
    @DecimalMax(value = "99999999", message = "项目价格是99999999")
    private BigDecimal itemPrice;


    /**
     * 所属子订单
     */
    @NotNull(message = "所所属子订单Id不能为空")
    private Long childOrderId;

    /**
     *
     * @return
     */

    @Override
    public Long getIdentity() {
        return getId();
    }
}
